Optimal. Leaf size=80 \[ \frac{(a-b)^2 \cos ^3(e+f x)}{3 f}-\frac{(a-3 b) (a-b) \cos (e+f x)}{f}+\frac{b (2 a-3 b) \sec (e+f x)}{f}+\frac{b^2 \sec ^3(e+f x)}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.083143, antiderivative size = 80, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.087, Rules used = {3664, 448} \[ \frac{(a-b)^2 \cos ^3(e+f x)}{3 f}-\frac{(a-3 b) (a-b) \cos (e+f x)}{f}+\frac{b (2 a-3 b) \sec (e+f x)}{f}+\frac{b^2 \sec ^3(e+f x)}{3 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3664
Rule 448
Rubi steps
\begin{align*} \int \sin ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (-1+x^2\right ) \left (a-b+b x^2\right )^2}{x^4} \, dx,x,\sec (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left ((2 a-3 b) b-\frac{(a-b)^2}{x^4}+\frac{(a-3 b) (a-b)}{x^2}+b^2 x^2\right ) \, dx,x,\sec (e+f x)\right )}{f}\\ &=-\frac{(a-3 b) (a-b) \cos (e+f x)}{f}+\frac{(a-b)^2 \cos ^3(e+f x)}{3 f}+\frac{(2 a-3 b) b \sec (e+f x)}{f}+\frac{b^2 \sec ^3(e+f x)}{3 f}\\ \end{align*}
Mathematica [A] time = 0.519778, size = 72, normalized size = 0.9 \[ \frac{\left (-9 a^2+42 a b-33 b^2\right ) \cos (e+f x)+(a-b)^2 \cos (3 (e+f x))+4 b \sec (e+f x) \left (6 a+b \sec ^2(e+f x)-9 b\right )}{12 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.049, size = 155, normalized size = 1.9 \begin{align*}{\frac{1}{f} \left ( -{\frac{{a}^{2} \left ( 2+ \left ( \sin \left ( fx+e \right ) \right ) ^{2} \right ) \cos \left ( fx+e \right ) }{3}}+2\,ab \left ({\frac{ \left ( \sin \left ( fx+e \right ) \right ) ^{6}}{\cos \left ( fx+e \right ) }}+ \left ( 8/3+ \left ( \sin \left ( fx+e \right ) \right ) ^{4}+4/3\, \left ( \sin \left ( fx+e \right ) \right ) ^{2} \right ) \cos \left ( fx+e \right ) \right ) +{b}^{2} \left ({\frac{ \left ( \sin \left ( fx+e \right ) \right ) ^{8}}{3\, \left ( \cos \left ( fx+e \right ) \right ) ^{3}}}-{\frac{5\, \left ( \sin \left ( fx+e \right ) \right ) ^{8}}{3\,\cos \left ( fx+e \right ) }}-{\frac{5\,\cos \left ( fx+e \right ) }{3} \left ({\frac{16}{5}}+ \left ( \sin \left ( fx+e \right ) \right ) ^{6}+{\frac{6\, \left ( \sin \left ( fx+e \right ) \right ) ^{4}}{5}}+{\frac{8\, \left ( \sin \left ( fx+e \right ) \right ) ^{2}}{5}} \right ) } \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.07297, size = 108, normalized size = 1.35 \begin{align*} \frac{{\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{3} - 3 \,{\left (a^{2} - 4 \, a b + 3 \, b^{2}\right )} \cos \left (f x + e\right ) + \frac{3 \,{\left (2 \, a b - 3 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + b^{2}}{\cos \left (f x + e\right )^{3}}}{3 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.93564, size = 193, normalized size = 2.41 \begin{align*} \frac{{\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{6} - 3 \,{\left (a^{2} - 4 \, a b + 3 \, b^{2}\right )} \cos \left (f x + e\right )^{4} + 3 \,{\left (2 \, a b - 3 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + b^{2}}{3 \, f \cos \left (f x + e\right )^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.74691, size = 194, normalized size = 2.42 \begin{align*} \frac{6 \, a b \cos \left (f x + e\right )^{2} - 9 \, b^{2} \cos \left (f x + e\right )^{2} + b^{2}}{3 \, f \cos \left (f x + e\right )^{3}} + \frac{a^{2} f^{11} \cos \left (f x + e\right )^{3} - 2 \, a b f^{11} \cos \left (f x + e\right )^{3} + b^{2} f^{11} \cos \left (f x + e\right )^{3} - 3 \, a^{2} f^{11} \cos \left (f x + e\right ) + 12 \, a b f^{11} \cos \left (f x + e\right ) - 9 \, b^{2} f^{11} \cos \left (f x + e\right )}{3 \, f^{12}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]